<template>
	<view class="order">
		<view class="order-top">
			<view class="order-tabbar">
				<liuyuno-tabs :tabData="catList" :activeIndex="tabIndex" @tabClick='tab' class="nav"/>
			</view>
		</view>
		<view class="order-list">
			<view class="order" v-for="item in 20">
				<order-item></order-item>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				catList: [{"id":"0","name":"全部"},{"id":"1","name":"待付款"},{"id":"2","name":"待发货"},{"id":"3","name":"已发货"},{"id":"4","name":"退款/售后"}],
				tabIndex:0,
			}
		},
		onLoad(options) {
			if(options.status&&options.status<this.catList.length){
				this.tabIndex = parseInt(options.status);
			}else{
				this.tabIndex = 0
			}
		},
		methods: {
			tab(e){
				console.log(e);
				this.tabIndex = e
			}
		}
	}
</script>

<style lang="scss" scoped>
	.order{
		width: 100%;
		display: flex;
		flex-direction: column;
	}
	.order-top{
		position: sticky;
		top: 0;
		z-index: 10;
		background: #fff;
		padding: 20rpx 0;
	}
	.order-list{
		padding: 20rpx;		
	}
</style>
